package com.casino.tool;

public class P implements Cloneable {
	private int color;
	private int num;

	public Object clone() {
		P o = null;
		try {
			o = (P) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return o;
	}

	public String print() {
		String s =  getNums();
		System.out.print(s);
		return s;
	}

	public String printN() {
		String s = getColorS() + getNums();
		return s;
	}

	public void setNums(String s) {
		if (s.equals("A")) {
			num = 14;
		} else if (s.equals("K")) {
			num = 13;
		} else if (s.equals("Q")) {
			num = 12;
		} else if (s.equals("J")) {
			num = 11;
		} else if (s.equals("T")) {
			num = 10;
		} else if (s.equals("B")) {
			num = 8;
		} else if (s.equals("Z")) {
			num = 2;
		} else {
			num = Integer.parseInt(s);
		}

	}

	public String getNums() {
		if (num == 14) {
			return "A";
		} else if (num == 13) {
			return "K";
		} else if (num == 12) {
			return "Q";
		} else if (num == 11) {
			return "J";
		} else if (num == 10) {
			return "T";
		} else {
			return String.valueOf(num);
		}

	}

	public String getColorS() {
		if (color == 1) {
			return "♠";
		} else if (color == 2) {
			return "♥";
		} else if (color == 3) {
			return "♣";
		} else if (color == 4) {
			return "♦";
		}
		return "";
	}

	public int getColor() {
		return color;
	}

	public void setColor(int color) {
		this.color = color;
	}

	public void setColors(String color) {
		if (color.equals("d")) {
			this.color = 1;
		} else if (color.equals("s")) {
			this.color = 2;
		} else if (color.equals("h")) {
			this.color = 3;
		} else if (color.equals("c")) {
			this.color = 4;
		}
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

}
